cmake_minimum_required(VERSION 3.5)
project(wf_task1_pkg)

# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
  set(CMAKE_CXX_STANDARD 14)
endif()

set(CMAKE_BUILD_TYPE, "RELEASE")
set(CMAKE_CXX_FLAGS, "-O2 -g ${CMKAE_CXX_FLAGS}")

find_package(ament_cmake_auto REQUIRED)
find_package(OpenCV REQUIRED)
find_package(cv_bridge REQUIRED)
find_package(PCL REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(pcl_conversions REQUIRED)

ament_auto_find_build_dependencies()

include_directories(
  include
  ${OpenCV_INCLUDE_DIRS}
  ${PCL_INCLUDE_DIRS}
)


ament_auto_add_library(${PROJECT_NAME}_talker_node SHARED
  include/talker.hpp
  src/talker.cpp
)
ament_auto_add_library(${PROJECT_NAME}_listener_node SHARED
  include/listener.hpp
  src/listener.cpp
)


target_link_libraries(${PROJECT_NAME}_talker_node  ${OpenCV_LIBRARIES} ${PCL_LIBRARIES} ${cv_bridge_LIBRARIES})
target_link_libraries(${PROJECT_NAME}_listener_node ${OpenCV_LIBRARIES} ${PCL_LIBRARIES} ${cv_bridge_LIBRARISES})


rclcpp_components_register_node(${PROJECT_NAME}_talker_node
  PLUGIN "wf::talker::TalkerNode"
  EXECUTABLE ${PROJECT_NAME}_talker_exe
)
rclcpp_components_register_node(${PROJECT_NAME}_listener_node
  PLUGIN  "wf::listener::ListenerNode"
  EXECUTABLE ${PROJECT_NAME}_listener_exe
)


ament_auto_package(INSTALL_TO_SHARE launch param)


